import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

function im(fileName) {
    return () => import(`@/views/` + fileName + '/' + fileName);
}

const router = new VueRouter({
    routes: [
        {
            path: '/',
            name: 'Hello1',
            component: im('Main'),
        },
        {
            path: '*',
            name: 'Hello2',
            component: () => import('@/views/Main/Error'),
        },
        {
            path: '/multi-regex',
            name: 'multi-regex',
            component: im('MultiRegex'),
        },
        {
            path: '/shanbay-import-from-youdao',
            name: 'shanbay-import-from-youdao',
            component: im('ShanbayImportFromYoudao'),
        },
        {
            path: '/baidu-audio',
            name: 'baidu-audio',
            component: im('BaiduAudio'),
        },
    ],
});

export default router;
